<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello World!</title>
    <!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag -->
    <meta
      http-equiv="Content-Security-Policy"
      content="script-src 'self' 'unsafe-inline';"
    />
    <link rel="stylesheet" href="static/css/index.css" />
  </head>
  <body>
    <div id="container">
      <div id="content">
        <p></p>
      </div>
    </div>
    <script>
      window.onload = async function() {
        let ipcRenderer = window.require('electron').ipcRenderer;
        ipcRenderer.on('get-content', (e, config) => {
          const { content, fontSize, fontColor} = config;
          let dom = document.querySelector('#content p');
          dom.style.fontSize = `${fontSize}px`;
          dom.style.color = fontColor;
          dom.innerHTML = content;
        });
      };
    </script>
  </body>
</html>
